package com.ruoyi.gis.mapper;

import com.ruoyi.gis.domain.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface YcDataMapper {


    @Select("<script>" +
            " select " +
            " cjrq,lai,twso,tagp from yc_cl_data " +
            " where " +
            " device_code = #{deviceCode} " +
            " order by cjrq asc" +
            "</script>"
    )
    List<YcclData> selectDataListByDevice(@Param("deviceCode")String deviceCode);

    @Select("<script>" +
            " SELECT var_id varId,var_name  varName,cjrq, id,device_code deviceCode," +
            " channel_id channelId,cj_data cjData,var_unit  varUnit,format_value  formatValue " +
            " from yc_tr_data " +
            " where  device_code = #{deviceCode} and var_name = #{varName} " +
            " order by cjrq desc" +
            " limit 200  " +
            "</script>"
    )
    List<YcDeviceTrData> selectTrDataListByDevice(@Param("deviceCode")String deviceCode,
                                                  @Param("varName")String varName);

    @Select("<script>" +
            " SELECT var_id,var_name " +
            " from yc_tr_data " +
            " where device_code = #{deviceCode} " +
            " GROUP BY var_id,var_name " +
            "</script>"
    )
    List<YcDeviceTrType> listTrjcDataType(@Param("deviceCode")String deviceCode);

    @Select("<script>" +
            " SELECT device_code deviceCode,station_name  stationName,pjqw, zgqw,zdqw," +
            " jsl2020 ,jsl0808 ,jsl2008  ,jsl0820  ,rzss ,cjrq" +
            " from yc_qxz_data " +
            " where  device_code = #{deviceCode} " +
            " order by cjrq desc " +
            " limit 500  " +
            "</script>"
    )
    List<YcDeviceQxData> selectQxData(String deviceCode);
}
